import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';

export const columns: BasicColumn[] = [

  {
    title: '用户信息',
    dataIndex: 'memberId'
  },
  {
    title: '用户名称',
    dataIndex: 'memberName'
  },
  {
    title: '收益金额',
    dataIndex: 'amount'
  },

  {
    title: '收益类型',
    dataIndex: 'type'
  },
  {
    title: '锁定状态',
    dataIndex: 'isLocked',
    customRender: ({ text }) => {
      return text == 0 ? '锁定' : '未锁定';
    },
  },


  {
    title: '收益前总金额',
    dataIndex: 'beforeAmount'
  },
  {
    title: '收益后金额',
    dataIndex: 'afterAmount'
  },
];

export const searchFormSchema: FormSchema[] = [

  {
    label: '会员信息',
    field: 'memberId',
    component: 'Input'
  },
  {
    label: '收益类型',
    field: 'selectType',
    component: 'JSearchSelect',
    componentProps: {
      dict: "selectType"
    },
  },
];

export const formSchema: FormSchema[] = [
  // TODO 主键隐藏字段，目前写死为ID
  { label: '', field: 'id', component: 'Input', show: false },

  {
    label: '会员信息',
    field: 'memberId',
    component: 'Input',
  },
  {
    label: '会员名称',
    field: 'memberName',
    component: 'Input',
  },
  {
    label: '收益金额',
    field: 'amount',
    component: 'InputNumber',
  },
  {
    label: '收益类型',
    field: 'type',
    component: 'Input',
  },
  {
    label: '是否为锁定 0锁定 1未锁定',
    field: 'isLocked',
    component: 'InputNumber',
  },


  {
    label: '收益前总金额',
    field: 'beforeAmount',
    component: 'InputNumber',
  },
  {
    label: '收益后金额',
    field: 'afterAmount',
    component: 'InputNumber',
  },
];
